package com.hzhh123.sample.controller;

import com.hzhh123.crypto.annotation.decrypt.Decrypt;
import com.hzhh123.crypto.annotation.encrypt.Encrypt;
import com.hzhh123.crypto.entity.Result;
import com.hzhh123.crypto.entity.ResultBuilder;
import com.hzhh123.crypto.enums.EncrptyTypeEnum;
import com.hzhh123.sample.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hzhh123
 * @version 1.0
 * @date 2022/4/13 14:47
 * @des
 *
 *
 */
@Slf4j
@RestController
@Decrypt(type = EncrptyTypeEnum.AES)
@Encrypt("SM2")
//@Base64Encrypt
public class Test1Controller implements ResultBuilder {

    @GetMapping("/test1")
    public ResponseEntity<Result<?>> test1(@RequestBody User user){
        log.info("{}",user);
        return success(user);
    }

    @GetMapping("/test2")
    public ResponseEntity<Result<?>> test2(User user){
        log.info("{}",user);
        return success(user);
    }
}
